package com.gilight.base.controller.uiapp;

import com.baomidou.mybatisplus.extension.api.R;
import com.gilight.base.admin.brand.AdminBrandService;
import com.gilight.base.base.ResultEntity;
import com.gilight.base.base.exception.ServiceException;
import com.gilight.base.dto.IntegralIndexDataDTO;
import com.gilight.base.service.integral.IntegralService;
import com.gilight.base.uiapp.category.CategoryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author liken
 * 商品管理控制类
 */
@RestController
@RequestMapping("/web/app-integral")
public class AppIntegralController {

    @Autowired
    private IntegralService integralService;
    @Autowired
    private AdminBrandService adminBrandService;
    /**
     * 获取首页聚合数据
     * @return
     * @throws ServiceException
     */
    @ApiOperation(value = "聚合接口")
    @RequestMapping(value = "/index-data", method = {RequestMethod.GET})
    public ResultEntity getIndexData(Long zzjgId,Long brandId) throws ServiceException{
        ResultEntity resultEntity = new ResultEntity();
        resultEntity.setData(integralService.getIndexData(zzjgId,brandId));
        return resultEntity;
    }
    @ApiOperation(value = "所有")
    @RequestMapping(value = "/get/{id}")
    public ResultEntity get(@PathVariable Long id) throws ServiceException{

        ResultEntity resultEntity = new ResultEntity();
        resultEntity.setData(adminBrandService.getById(id));
        return resultEntity;
    }
}
